package com.cgy.utils.spider.cookie;

import java.util.List;

import com.google.common.collect.Lists;

/**
 * Cookie配置
 * @author CH
 *
 */
public class Cookies {

	public List<Cookie> lCookie;
	/**
	 * 初始化
	 * @return
	 */
	public Cookies create() {
		this.lCookie = Lists.newArrayList();
		return new Cookies();
	}
	/**
	 * 添加cookie
	 * @param key 索引
	 * @param value 值
	 * @return
	 */
	public Cookies cookie(String key, String value) {
		Cookie cookie = new Cookie();
		cookie.setCookieKey(key);
		cookie.setCookieVal(value);
		lCookie.add(cookie);
		return this;
	}
	/**
	 * 获取所有cookie
	 * @return
	 */
	public List<Cookie> getCookie() {
		return this.lCookie;
	}
	
}
